"""
"sub_order_id": "DFSUB-588E7FDE4C0E4CCA8",
"yuan_jia": Int32("1693"),
"li_xi": Int32("338"),
"should_pay": Int32("2031"),
"pay_status": "已支付",
"should_pay_date": "2025-02-22"
"""

from datetime import datetime
from base.mongo.mymongodb import Mongodb


class Manager:
    def __init__(self):
        self.mongo = Mongodb()

    def get_person(self):
        orders = self.mongo["advance_order"].find({
            "pay_status": "待支付"
        })
        for order in orders:
            pay_list = order.get("pay_list")
            for pay in pay_list:
                if pay.get("pay_status") == "待支付" and datetime.strptime(pay.get("should_pay_date"), "%Y-%m-%d") <= datetime.now():
                    print(f"owner_wx: {order.get('owner_wx')}, yuan_jia: {pay.get('yuan_jia')}, li_xi: {pay.get('li_xi')}, should_pay: {pay.get('should_pay')}")      
    
        
if  __name__ ==  "__main__":
    obj = Manager()
    obj.get_person()